package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * ContractorCost generated by hbm2java
 */
@Entity
@Table(name = "CONTRACTOR_COST", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = {
		"CONTRACTOR_ID", "COST_ID" }))
public class ContractorCost implements java.io.Serializable {

	private ContractorCostId id;
	private Objects objects;
	private Costs costs;

	public ContractorCost() {
	}

	public ContractorCost(ContractorCostId id, Objects objects, Costs costs) {
		this.id = id;
		this.objects = objects;
		this.costs = costs;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "contractorId", column = @Column(name = "CONTRACTOR_ID", nullable = false)),
			@AttributeOverride(name = "costId", column = @Column(name = "COST_ID", nullable = false)) })
	public ContractorCostId getId() {
		return this.id;
	}

	public void setId(ContractorCostId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CONTRACTOR_ID", nullable = false, insertable = false, updatable = false)
	public Objects getObjects() {
		return this.objects;
	}

	public void setObjects(Objects objects) {
		this.objects = objects;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "COST_ID", nullable = false, insertable = false, updatable = false)
	public Costs getCosts() {
		return this.costs;
	}

	public void setCosts(Costs costs) {
		this.costs = costs;
	}

}
